From: Florian Müllner Date: Wed, 11 Mar 2015 21:33:20 +0000 (+0100) Subject: calendar: Only show close button on messages that can be cleared X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~1512 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=e72450f5d84ea147ba7de65e339bfa9f5d340189;p=gnome-shell.git calendar: Only show close button on messages that can be cleared Currently closing all messages is subtly different from clearing a section, which is confusing. Start making the behavior more predictable by only showing a close button in the message when the section's clear button would remove it. https://bugzilla.gnome.org/show_bug.cgi?id=746027 --- diff --git a/js/ui/calendar.js b/js/ui/calendar.js index e85672011..af349665b 100644 --- a/js/ui/calendar.js +++ b/js/ui/calendar.js @@ -1137,13 +1137,13 @@ const Message = new Lang.Class({ } }, - canClear: function() { + canClose: function() { return true; }, _sync: function() { let hovered = this.actor.hover; - this._closeButton.visible = hovered; + this._closeButton.visible = hovered && this.canClose(); this._secondaryBin.visible = !hovered; }, @@ -1206,7 +1206,7 @@ const NotificationMessage = new Lang.Class({ this.setUseBodyMarkup(n.bannerBodyMarkup); }, - canClear: function() { + canClose: function() { return !this.notification.resident; }, @@ -1376,7 +1376,7 @@ const MessageListSection = new Lang.Class({ clear: function() { let messages = [...this._messages.keys()].filter(function(message) { - return message.canClear(); + return message.canClose(); }); // If there are few messages, letting them all zoom out looks OK @@ -1405,7 +1405,7 @@ const MessageListSection = new Lang.Class({ _canClear: function() { for (let message of this._messages.keys()) - if (message.canClear()) + if (message.canClose()) return true; return false; },